package com.neuedu.wp.controller;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/product")
public class ProductController {


    /**
     * http://www.aaaa.com/xxx/product/list
     * http://127.0.0.1/xxx/product/list
     * http://192.168.77.11/product/list
     * @return
     */
    @GetMapping("/list")
    public List<Map> list() {

        List list = new ArrayList();
        for (int i = 0; i < 10; i++) {
            HashMap<Object, Object> product = new HashMap<>();

            product.put("id", "id" + i);
            product.put("name", "商品名称"+i);
            product.put("price",  i );
            product.put("detail",  "" );
            product.put("introduce", "" );

            list.add(product);
        }


        return list;

    }


}
